package com.qianli.cashmama.trade.dao.impl;

import com.fqgj.common.base.AbstractBaseMapper;
import com.qianli.cashmama.trade.dao.TBillRepaymentAccountingDao;
import com.qianli.cashmama.trade.entity.TBillRepaymentAccountingEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * User: zhihaoxie
 * Date: 2018-08-13
 * Time: 11:22:08.804
 */

@Repository
public class TBillRepaymentAccountingDaoImpl extends AbstractBaseMapper<TBillRepaymentAccountingEntity> implements TBillRepaymentAccountingDao {


    @Override
    public TBillRepaymentAccountingEntity selectByBizNo(String bizNo) {
        Map<String, Object> map = new HashMap<>();
        map.put("bizNo", bizNo);
        return getSqlSession().selectOne(getStatement("selectByBizNo"), map);
    }

    @Override
    public void updateSettlementById(TBillRepaymentAccountingEntity entity) {

        Map<String, Object> map = new HashMap<>();
        map.put("settlementAmount", entity.getSettlementAmount());
        map.put("payBizNo", entity.getPayBizNo());
        getSqlSession().update(this.getStatement("updateSettlementById"), map);

    }

    @Override
    public List<String> selectListTime() {
        return getSqlSession().selectList(getStatement("selectListTime"));

    }
}